const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.brandId 品牌Id
 * @param {} options.status 状态
 * @param {} options.beginCreateTime 创建时间-开始时间
 * @param {} options.endCreateTime 创建时间-结束时间
 * @param {} options.pageSize 每页数据量
 * @param {} options.pageIndex 指定页
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        brandId: req.query.brandId,
        status: req.query.status,
        beginCreateTime: req.query.beginCreateTime,
        endCreateTime: req.query.endCreateTime,
        pageSize: req.query.pageSize,
        pageIndex: req.query.pageIndex,
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id59',
                    brandCode: 'brandCode60',
                    brandName: 'brandName61',
                    dealerCode: 'dealerCode62',
                    typeName: 'typeName63',
                    amountRate: 1,
                    kindRate: 1,
                    feeRate: 1,
                    deliveryCycle: 1,
                    status: 1,
                    createTime: '2019-10-24T02:38:43Z',
                    remark: 'remark',
                    rowVersion: 'rowVersion',
                    options: [
                        'update'
                    ]
                },
                {
                    id: 'id64',
                    brandCode: 'brandCode65',
                    brandName: 'brandName66',
                    dealerCode: 'dealerCode67',
                    typeName: 'typeName68',
                    amountRate: 1,
                    kindRate: 1,
                    feeRate: 1,
                    deliveryCycle: 1,
                    status: 1,
                    createTime: '2019-10-24T02:38:43Z',
                    remark: 'remark',
                    rowVersion: 'rowVersion',
                    options: [
                        'update'
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id id
 * @throws {Error}
 * @return {Promise}
 */
router.get('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message',
        payload: {
            id: 'id69',
            brandId: 'brandId70',
            brandCode: 'brandCode71',
            brandName: 'brandName72',
            dealerId: 'dealerId73',
            dealerCode: 'dealerCode74',
            dealerName: 'dealerName75',
            typeId: 'typeId76',
            typeCode: 'typeCode77',
            typeName: 'typeName78',
            amountRate: 0.872,
            kindRate: 0.763,
            feeRate: 1,
            deliveryCycle: 1,
            remark: 'remark',
            rowVersion: 'rowVersion',
            options: [
                'update'
            ]
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 订单满足率规则Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 订单满足率规则Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/abandon', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
router.post('/import', (req, res) => {
    res.json({
        message: '导入成功'
    });
});
module.exports = router;
